package o;

import android.annotation.SuppressLint;
import android.content.Context;
import android.widget.ImageView;
import android.widget.ImageView.ScaleType;
import androidx.annotation.CheckResult;
import androidx.annotation.DrawableRes;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import androidx.annotation.RawRes;
import com.bumptech.glide.Glide;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.concurrent.Executor;

public class ro<TranscodeType> extends ze<ro<TranscodeType>> implements Cloneable {
    protected static final zp ॱ = ((zp) ((zp) ((zp) new zp().ˊ(tf.ˏ)).ॱ(rl.LOW)).ॱ(true));
    @Nullable
    private List<zn<TranscodeType>> ʻ;
    @NonNull
    private rq<?, ? super TranscodeType> ʼ;
    @Nullable
    private ro<TranscodeType> ʽ;
    private final Class<TranscodeType> ˊ;
    private boolean ˊॱ;
    private final Context ˋ;
    @Nullable
    private Float ˋॱ;
    private final Glide ˎ;
    private final rp ˏ;
    @Nullable
    private ro<TranscodeType> ˏॱ;
    private boolean ͺ;
    private boolean ॱˊ;
    private final rh ॱॱ;
    @Nullable
    private Object ᐝ;

    static /* synthetic */ class AnonymousClass1 {
        static final /* synthetic */ int[] ˎ = new int[ScaleType.values().length];

        static {
            ˏ = new int[rl.values().length];
            try {
                ˏ[rl.LOW.ordinal()] = 1;
            } catch (NoSuchFieldError e) {
            }
            try {
                ˏ[rl.NORMAL.ordinal()] = 2;
            } catch (NoSuchFieldError e2) {
            }
            try {
                ˏ[rl.HIGH.ordinal()] = 3;
            } catch (NoSuchFieldError e3) {
            }
            try {
                ˏ[rl.IMMEDIATE.ordinal()] = 4;
            } catch (NoSuchFieldError e4) {
            }
            try {
                ˎ[ScaleType.CENTER_CROP.ordinal()] = 1;
            } catch (NoSuchFieldError e5) {
            }
            try {
                ˎ[ScaleType.CENTER_INSIDE.ordinal()] = 2;
            } catch (NoSuchFieldError e6) {
            }
            try {
                ˎ[ScaleType.FIT_CENTER.ordinal()] = 3;
            } catch (NoSuchFieldError e7) {
            }
            try {
                ˎ[ScaleType.FIT_START.ordinal()] = 4;
            } catch (NoSuchFieldError e8) {
            }
            try {
                ˎ[ScaleType.FIT_END.ordinal()] = 5;
            } catch (NoSuchFieldError e9) {
            }
            try {
                ˎ[ScaleType.FIT_XY.ordinal()] = 6;
            } catch (NoSuchFieldError e10) {
            }
            try {
                ˎ[ScaleType.CENTER.ordinal()] = 7;
            } catch (NoSuchFieldError e11) {
            }
            try {
                ˎ[ScaleType.MATRIX.ordinal()] = 8;
            } catch (NoSuchFieldError e12) {
            }
        }
    }

    @CheckResult
    public /* synthetic */ Object clone() throws CloneNotSupportedException {
        return ˊ();
    }

    @CheckResult
    public /* synthetic */ ze ˎ() {
        return ˊ();
    }

    @CheckResult
    @NonNull
    public /* synthetic */ ze ˏ(@NonNull ze zeVar) {
        return ॱ(zeVar);
    }

    @SuppressLint({"CheckResult"})
    protected ro(@NonNull Glide glide, rp rpVar, Class<TranscodeType> cls, Context context) {
        this.ॱˊ = true;
        this.ˎ = glide;
        this.ˏ = rpVar;
        this.ˊ = cls;
        this.ˋ = context;
        this.ʼ = rpVar.ˏ((Class) cls);
        this.ॱॱ = glide.ॱ();
        ˊ(rpVar.ʽ());
        ॱ(rpVar.ʻ());
    }

    @SuppressLint({"CheckResult"})
    protected ro(Class<TranscodeType> cls, ro<?> roVar) {
        this(roVar.ˎ, roVar.ˏ, cls, roVar.ˋ);
        this.ᐝ = roVar.ᐝ;
        this.ˊॱ = roVar.ˊॱ;
        ॱ((ze) roVar);
    }

    @SuppressLint({"CheckResult"})
    private void ˊ(List<zn<Object>> list) {
        for (zn ˊ : list) {
            ˊ(ˊ);
        }
    }

    @CheckResult
    @NonNull
    public ro<TranscodeType> ॱ(@NonNull ze<?> zeVar) {
        aas.ˎ(zeVar);
        return (ro) super.ˏ((ze) zeVar);
    }

    @CheckResult
    @NonNull
    public ro<TranscodeType> ॱ(@Nullable zn<TranscodeType> znVar) {
        this.ʻ = null;
        return ˊ((zn) znVar);
    }

    @CheckResult
    @NonNull
    public ro<TranscodeType> ˊ(@Nullable zn<TranscodeType> znVar) {
        if (znVar != null) {
            if (this.ʻ == null) {
                this.ʻ = new ArrayList();
            }
            this.ʻ.add(znVar);
        }
        return this;
    }

    @CheckResult
    @NonNull
    public ro<TranscodeType> ˏ(@Nullable ro<TranscodeType> roVar) {
        this.ʽ = roVar;
        return this;
    }

    @CheckResult
    @NonNull
    public ro<TranscodeType> ˋ(@Nullable Object obj) {
        return ˎ(obj);
    }

    @NonNull
    private ro<TranscodeType> ˎ(@Nullable Object obj) {
        this.ᐝ = obj;
        this.ˊॱ = true;
        return this;
    }

    @CheckResult
    @NonNull
    public ro<TranscodeType> ˎ(@Nullable String str) {
        return ˎ((Object) str);
    }

    @CheckResult
    @NonNull
    public ro<TranscodeType> ˊ(@Nullable File file) {
        return ˎ((Object) file);
    }

    @CheckResult
    @NonNull
    public ro<TranscodeType> ˋ(@RawRes @DrawableRes @Nullable Integer num) {
        return ˎ((Object) num).ॱ(zp.ˊ(aah.ˊ(this.ˋ)));
    }

    @CheckResult
    public ro<TranscodeType> ˊ() {
        ro<TranscodeType> roVar = (ro) super.ˎ();
        roVar.ʼ = roVar.ʼ.ॱ();
        return roVar;
    }

    @NonNull
    public <Y extends zz<TranscodeType>> Y ˏ(@NonNull Y y) {
        return ˊ(y, null, aan.ˎ());
    }

    @NonNull
    <Y extends zz<TranscodeType>> Y ˊ(@NonNull Y y, @Nullable zn<TranscodeType> znVar, Executor executor) {
        return ˋ(y, znVar, this, executor);
    }

    private <Y extends zz<TranscodeType>> Y ˋ(@NonNull Y y, @Nullable zn<TranscodeType> znVar, ze<?> zeVar, Executor executor) {
        aas.ˎ(y);
        if (this.ˊॱ) {
            zm ˊ = ˊ(y, znVar, zeVar, executor);
            zm request = y.getRequest();
            if (!ˊ.ˏ(request) || ˊ(zeVar, request)) {
                this.ˏ.ˎ(y);
                y.setRequest(ˊ);
                this.ˏ.ˏ(y, ˊ);
            } else if (!((zm) aas.ˎ(request)).ˋ()) {
                request.ˏ();
            }
            return y;
        }
        throw new IllegalArgumentException("You must call #load() before calling #into()");
    }

    private boolean ˊ(ze<?> zeVar, zm zmVar) {
        return !zeVar.ˊᐝ() && zmVar.ˎ();
    }

    @NonNull
    public aab<ImageView, TranscodeType> ˏ(@NonNull ImageView imageView) {
        ze ᐝ;
        aau.ॱ();
        aas.ˎ(imageView);
        if (!(ॱ() || !ˋ() || imageView.getScaleType() == null)) {
            switch (AnonymousClass1.ˎ[imageView.getScaleType().ordinal()]) {
                case 1:
                    ᐝ = ˎ().ᐝ();
                    break;
                case 2:
                    ᐝ = ˎ().ॱˊ();
                    break;
                case 3:
                case 4:
                case 5:
                    ᐝ = ˎ().ʼ();
                    break;
                case 6:
                    ᐝ = ˎ().ॱˊ();
                    break;
            }
        }
        ᐝ = this;
        return (aab) ˋ(this.ॱॱ.ˏ(imageView, this.ˊ), null, ᐝ, aan.ˎ());
    }

    @Deprecated
    public zl<TranscodeType> ॱ(int i, int i2) {
        return ˎ(i, i2);
    }

    @NonNull
    public zl<TranscodeType> ˎ(int i, int i2) {
        Object zkVar = new zk(i, i2);
        return (zl) ˊ(zkVar, zkVar, aan.ˋ());
    }

    @CheckResult
    @Deprecated
    public zl<File> ˏ(int i, int i2) {
        return ˏ().ˎ(i, i2);
    }

    @CheckResult
    @NonNull
    protected ro<File> ˏ() {
        return new ro(File.class, this).ॱ(ॱ);
    }

    @NonNull
    private rl ˏ(@NonNull rl rlVar) {
        switch (rlVar) {
            case LOW:
                return rl.NORMAL;
            case NORMAL:
                return rl.HIGH;
            case HIGH:
            case IMMEDIATE:
                return rl.IMMEDIATE;
            default:
                throw new IllegalArgumentException("unknown priority: " + ˊˊ());
        }
    }

    private zm ˊ(zz<TranscodeType> zzVar, @Nullable zn<TranscodeType> znVar, ze<?> zeVar, Executor executor) {
        return ॱ(new Object(), zzVar, znVar, null, this.ʼ, zeVar.ˊˊ(), zeVar.ˎˎ(), zeVar.ˋᐝ(), zeVar, executor);
    }

    private zm ॱ(Object obj, zz<TranscodeType> zzVar, @Nullable zn<TranscodeType> znVar, @Nullable zj zjVar, rq<?, ? super TranscodeType> rqVar, rl rlVar, int i, int i2, ze<?> zeVar, Executor executor) {
        zm zmVar;
        zj zjVar2;
        if (this.ˏॱ != null) {
            zi ziVar = new zi(obj, zjVar);
            zmVar = ziVar;
            zjVar2 = ziVar;
        } else {
            zmVar = null;
            zjVar2 = zjVar;
        }
        zm ˊ = ˊ(obj, (zz) zzVar, (zn) znVar, zjVar2, (rq) rqVar, rlVar, i, i2, (ze) zeVar, executor);
        if (zmVar == null) {
            return ˊ;
        }
        int ˎˎ = this.ˏॱ.ˎˎ();
        int ˋᐝ = this.ˏॱ.ˋᐝ();
        if (aau.ˊ(i, i2) && !this.ˏॱ.ˌ()) {
            ˎˎ = zeVar.ˎˎ();
            ˋᐝ = zeVar.ˋᐝ();
        }
        zmVar.ˎ(ˊ, this.ˏॱ.ॱ(obj, zzVar, znVar, zmVar, this.ˏॱ.ʼ, this.ˏॱ.ˊˊ(), ˎˎ, ˋᐝ, this.ˏॱ, executor));
        return zmVar;
    }

    private zm ˊ(Object obj, zz<TranscodeType> zzVar, zn<TranscodeType> znVar, @Nullable zj zjVar, rq<?, ? super TranscodeType> rqVar, rl rlVar, int i, int i2, ze<?> zeVar, Executor executor) {
        zj zsVar;
        if (this.ʽ != null) {
            if (this.ͺ) {
                throw new IllegalStateException("You cannot use a request as both the main request and a thumbnail, consider using clone() on the request(s) passed to thumbnail()");
            }
            rq<?, ? super TranscodeType> rqVar2;
            rl ˊˊ;
            int i3;
            int i4;
            rq<?, ? super TranscodeType> rqVar3 = this.ʽ.ʼ;
            if (this.ʽ.ॱˊ) {
                rqVar2 = rqVar;
            } else {
                rqVar2 = rqVar3;
            }
            if (this.ʽ.ˊˋ()) {
                ˊˊ = this.ʽ.ˊˊ();
            } else {
                ˊˊ = ˏ(rlVar);
            }
            int ˎˎ = this.ʽ.ˎˎ();
            int ˋᐝ = this.ʽ.ˋᐝ();
            if (!aau.ˊ(i, i2) || this.ʽ.ˌ()) {
                i3 = ˋᐝ;
                i4 = ˎˎ;
            } else {
                ˎˎ = zeVar.ˎˎ();
                i3 = zeVar.ˋᐝ();
                i4 = ˎˎ;
            }
            zsVar = new zs(obj, zjVar);
            zm ˊ = ˊ(obj, (zz) zzVar, (zn) znVar, (ze) zeVar, zsVar, (rq) rqVar, rlVar, i, i2, executor);
            this.ͺ = true;
            zm ॱ = this.ʽ.ॱ(obj, zzVar, znVar, zsVar, rqVar2, ˊˊ, i4, i3, this.ʽ, executor);
            this.ͺ = false;
            zsVar.ˊ(ˊ, ॱ);
            return zsVar;
        } else if (this.ˋॱ == null) {
            return ˊ(obj, (zz) zzVar, (zn) znVar, (ze) zeVar, zjVar, (rq) rqVar, rlVar, i, i2, executor);
        } else {
            zsVar = new zs(obj, zjVar);
            zsVar.ˊ(ˊ(obj, (zz) zzVar, (zn) znVar, (ze) zeVar, zsVar, (rq) rqVar, rlVar, i, i2, executor), ˊ(obj, (zz) zzVar, (zn) znVar, zeVar.ˎ().ˎ(this.ˋॱ.floatValue()), zsVar, (rq) rqVar, ˏ(rlVar), i, i2, executor));
            return zsVar;
        }
    }

    private zm ˊ(Object obj, zz<TranscodeType> zzVar, zn<TranscodeType> znVar, ze<?> zeVar, zj zjVar, rq<?, ? super TranscodeType> rqVar, rl rlVar, int i, int i2, Executor executor) {
        return zr.ˊ(this.ˋ, this.ॱॱ, obj, this.ᐝ, this.ˊ, zeVar, i, i2, rlVar, zzVar, znVar, this.ʻ, zjVar, this.ॱॱ.ˏ(), rqVar.ˋ(), executor);
    }
}
